package com.zui.util;

import java.io.Serializable;


/**
 * {"groupOp":"AND","rules":[{"field":"catalogName","op":"bw","data":"2"},
 * {"field":"parentCatalog.catalogName","op":"bw","data":"1"}]}
 * 
 * @author Sam
 * @since 1.0
 */
public class JQGridFilterRule implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public JQGridFilterRule() {
		
	}
	public JQGridFilterRule(String[] hierarchyFields, String field, String op, String data) {
		this.hierarchyFields = hierarchyFields;
		this.field = field;
		this.op = op;
		this.data = data;
		this.isAssociation = true;
	}
	public JQGridFilterRule(String field, String op, String data) {
		this.field = field;
		this.op = op;
		this.data = data;
	}
	/**
	 * 查询关联表的字段时为true,此时使用hierarchyFields
	 */
	private boolean isAssociation;
	/**
	 * e.g. String[0]=cat, String[1]=mother
	 */
	private String[] hierarchyFields;
	private String field;
	private String op;
	private String data;
	
	public String getField() {
		return field;
	}
	public void setField(String field) {
		this.field = field;
	}
	public String getOp() {
		return op;
	}
	public void setOp(String op) {
		this.op = op;
	}
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
	public boolean isAssociation() {
		return isAssociation;
	}
	public void setAssociation(boolean isAssociation) {
		this.isAssociation = isAssociation;
	}
	public String[] getHierarchyFields() {
		return hierarchyFields;
	}
	public void setHierarchyFields(String[] hierarchyFields) {
		this.hierarchyFields = hierarchyFields;
	}
	
	
}